|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jme3.app.state.AbstractAppState
ga.view.appstate.RootNodeState
ga.view.appstate.SceneState
ga.view.streaming.StreamingEvaluationState<T>
T - The generic type of the individuals.public class StreamingEvaluationState<T extends IIndividual<T>>
This interactive evaluator provides a stream of pictures of the show room. There are 2 zones to upvote/downvote the individuals.
| Nested Class Summary | |
|---|---|
private class |
StreamingEvaluationState.DragListener
This is a mouse listener that detects drag-and-drop. |
private class |
StreamingEvaluationState.ViewSwitchListener
Keyboard listener to switch the perspective. |
| Field Summary | |
|---|---|
private ISIGA<T> |
algorithm
|
private java.util.List<AnchorNode<T>> |
anchorNodes
|
private com.jme3.app.Application |
app
|
private com.jme3.bullet.BulletAppState |
bulletAppState
|
private CameraSettings |
camSettings
|
private StreamingEvaluationState.DragListener |
dragListener
|
private boolean |
enabled
|
private java.util.List<EvaluationListener<T>> |
listeners
|
private static java.util.logging.Logger |
LOGGER
|
private EvaluationNode |
lowerBox
|
private MenuListener |
menuListener
|
private boolean |
mouseDown
|
private static float |
PANEL_SPACING
|
private com.jme3.scene.Node |
panelsNode
|
private IPhenotypeGenerator<T,? extends com.jme3.scene.Spatial> |
phenotypeGenerator
|
private com.jme3.scene.Geometry |
pointer
|
private com.jme3.bullet.control.RigidBodyControl |
pointerControl
|
static float |
SCENE_WIDTH
|
private com.jme3.system.AppSettings |
settings
|
private ShowRoomFactory |
showRoomFactory
|
private ShowRoomState<T> |
showRoomState
|
private float |
speed
|
private ShowRoomSettings |
srSettings
|
private EvaluationNode |
upperBox
|
| Fields inherited from class ga.view.appstate.SceneState |
|---|
assetManager, cam, inputManager, renderManager, stateManager, timer, viewPort |
| Fields inherited from class ga.view.appstate.RootNodeState |
|---|
rootNode |
| Fields inherited from class com.jme3.app.state.AbstractAppState |
|---|
initialized |
| Constructor Summary | |
|---|---|
StreamingEvaluationState(IPhenotypeGenerator<T,? extends com.jme3.scene.Spatial> phenotypeGenerator)
Instantiates a new streaming evaluation state. |
|
| Method Summary | |
|---|---|
void |
addEvaluationListener(EvaluationListener<T> listener)
Adds an EvaluationListener that will be notified about the
evaluation state. |
void |
cleanup()
|
private void |
createPanel(T individual)
Creates a panel for an individual. |
void |
evaluate(T individual)
Evaluates the given individual. |
private com.jme3.collision.CollisionResults |
findPick(com.jme3.scene.Node node)
Finds spatials in the scene that has been clicked. |
void |
fireIndividualEvaluated(T individual)
Notification method that causes all EvaluationListeners being
notified that the evaluator has evaluated the individual. |
void |
fireNewIndividualRequested()
Notification method that causes all EvaluationListeners being
notified that the evaluator demands a new individual for evaluation. |
ISIGA<T> |
getAlgorithm()
Getter for the interactive genetic algorithm. |
private com.jme3.bullet.PhysicsSpace |
getPhysicsSpace()
Gets the physics space. |
private void |
initCam()
Inits the cam. |
void |
initialize(com.jme3.app.state.AppStateManager stateManager,
com.jme3.app.Application app)
|
private void |
initPointer()
Inits the pointer. |
private void |
initTable()
Make a solid floor and add it to the scene. |
private void |
removeAnchorNode(AnchorNode<T> anchorNode)
This is called when the anchorNode goes out of the screen without being evaluated. |
void |
removeEvaluationListener(EvaluationListener<T> listener)
Adds an EvaluationListener. |
private void |
removePanel(PanelNode<T> panelNode)
Removes a panel from the scene. |
void |
setAlgorithm(ISIGA<T> algorithm)
Sets the interactive genetic algorithm. |
void |
setEnabled(boolean enabled)
|
void |
setMenuListener(MenuListener menuListener)
Sets the menu listener. |
private void |
showInShowRoom(PanelNode<T> panelNode)
Shows a panel node in show room. |
void |
update(float tpf)
|
| Methods inherited from class ga.view.appstate.SceneState |
|---|
finalCleanUp, getCamera |
| Methods inherited from class ga.view.appstate.RootNodeState |
|---|
getRootNode |
| Methods inherited from class com.jme3.app.state.AbstractAppState |
|---|
isEnabled, isInitialized, postRender, render, stateAttached, stateDetached |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final float SCENE_WIDTH
private static final float PANEL_SPACING
private static final java.util.logging.Logger LOGGER
private com.jme3.scene.Geometry pointer
private boolean mouseDown
private com.jme3.bullet.control.RigidBodyControl pointerControl
private com.jme3.scene.Node panelsNode
private final IPhenotypeGenerator<T extends IIndividual<T>,? extends com.jme3.scene.Spatial> phenotypeGenerator
private ShowRoomFactory showRoomFactory
private final ShowRoomSettings srSettings
private final com.jme3.bullet.BulletAppState bulletAppState
private ShowRoomState<T extends IIndividual<T>> showRoomState
private EvaluationNode lowerBox
private EvaluationNode upperBox
private final java.util.List<AnchorNode<T extends IIndividual<T>>> anchorNodes
private final java.util.List<EvaluationListener<T extends IIndividual<T>>> listeners
private final StreamingEvaluationState.DragListener dragListener
private CameraSettings camSettings
private MenuListener menuListener
private com.jme3.system.AppSettings settings
private float speed
private boolean enabled
private ISIGA<T extends IIndividual<T>> algorithm
private com.jme3.app.Application app
| Constructor Detail |
|---|
public StreamingEvaluationState(IPhenotypeGenerator<T,? extends com.jme3.scene.Spatial> phenotypeGenerator)
phenotypeGenerator - the phenotype generator| Method Detail |
|---|
public void setMenuListener(MenuListener menuListener)
IMenuListenerParent
setMenuListener in interface IMenuListenerParentmenuListener - the new menu listener
public void initialize(com.jme3.app.state.AppStateManager stateManager,
com.jme3.app.Application app)
initialize in interface com.jme3.app.state.AppStateinitialize in class SceneStatepublic void cleanup()
cleanup in interface com.jme3.app.state.AppStatecleanup in class RootNodeStatepublic void setEnabled(boolean enabled)
setEnabled in interface com.jme3.app.state.AppStatesetEnabled in class SceneStatepublic void update(float tpf)
update in interface com.jme3.app.state.AppStateupdate in class RootNodeStateprivate void initCam()
private void initTable()
private void initPointer()
private com.jme3.collision.CollisionResults findPick(com.jme3.scene.Node node)
node - The parent node to check for clicks.
private com.jme3.bullet.PhysicsSpace getPhysicsSpace()
public void setAlgorithm(ISIGA<T> algorithm)
IInteractiveFitnessEvaluator
setAlgorithm in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>algorithm - The SIGA.public ISIGA<T> getAlgorithm()
IInteractiveFitnessEvaluator
getAlgorithm in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>private void showInShowRoom(PanelNode<T> panelNode)
panelNode - the panel nodeprivate void createPanel(T individual)
individual - the individualprivate void removeAnchorNode(AnchorNode<T> anchorNode)
anchorNode - The anchor node that leaves the screenprivate void removePanel(PanelNode<T> panelNode)
panelNode - the panel nodepublic void fireNewIndividualRequested()
IInteractiveFitnessEvaluatorEvaluationListeners being
notified that the evaluator demands a new individual for evaluation.
fireNewIndividualRequested in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>public void fireIndividualEvaluated(T individual)
IInteractiveFitnessEvaluatorEvaluationListeners being
notified that the evaluator has evaluated the individual.
fireIndividualEvaluated in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>individual - The evaluated individual.public void addEvaluationListener(EvaluationListener<T> listener)
IInteractiveFitnessEvaluatorEvaluationListener that will be notified about the
evaluation state.
addEvaluationListener in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>listener - The listener.public void removeEvaluationListener(EvaluationListener<T> listener)
IInteractiveFitnessEvaluatorEvaluationListener.
removeEvaluationListener in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>listener - The listener.public void evaluate(T individual)
IFitnessEvaluator
evaluate in interface IFitnessEvaluator<T extends IIndividual<T>>evaluate in interface IInteractiveFitnessEvaluator<T extends IIndividual<T>>individual - Individual to evaluate.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||